package com.shujia.wyh.day12.homework.info;

//商品编号，商品名称，所属类别，商品数量（大于0），商品价格（大于0），
public class ProductionInfo {
    private String proId;
    private String proName;
    private Category category;
    private int proNum;
    private double price;

    public ProductionInfo() {
    }

    public ProductionInfo(String proId, String proName, Category category, int proNum, double price) {
        this.proId = proId;
        this.proName = proName;
        this.category = category;
        this.proNum = proNum;
        this.price = price;
    }

    public String getProId() {
        return proId;
    }

    public void setProId(String proId) {
        this.proId = proId;
    }

    public String getProName() {
        return proName;
    }

    public void setProName(String proName) {
        this.proName = proName;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public int getProNum() {
        return proNum;
    }

    public void setProNum(int proNum) {
        if(proNum>0){
            this.proNum = proNum;
        }else {
            this.proNum = 0;
            System.out.println("库存数量异常，请练习管理员");
        }

    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void show() {

        System.out.println("商品名称：" + proName);
        System.out.println("所属类别：" + category.getCateName());
        System.out.println("商品售价：" + price);
        System.out.println("库存数量：" + proNum);
        System.out.println("商品总价：" + (proNum * price));
    }
}
